home *** CD-ROM | disk | FTP | other *** search
/ PC Player 2004 May / pc player 2004-05.iso / Demos / FarCry / Data1.cab / _7730D1BA00A3431BA056919A240981B3 < prev    next >
Encoding:
Text File  |  2004-01-06  |  713 b   |  25 lines

  1.       #include "../CGVPMacro.csi"
  2.  
  3.       MainInput { uniform sampler2D baseMap : texunit0,
  4.                   uniform sampler2D lightMap : texunit1,
  5.                   uniform float4 Ambient }
  6.       DeclarationsScript
  7.       {
  8.         OUT_T0_T1
  9.         FOUT
  10.       }
  11.       CoreScript
  12.       {
  13.         // load the decal
  14.         float4 decalColor = tex2D(baseMap, IN.Tex0.xy);
  15.         // load the lm
  16.         float4 lmColor = tex2D(lightMap, IN.Tex1.xy);
  17.         float3 dif = (decalColor.xyz * lmColor.xyz) * 4;
  18.         float3 amb = decalColor.xyz * Ambient.xyz;
  19.  
  20.         // finally add them all together
  21.         OUT.Color.xyz = amb + dif;
  22.         OUT.Color.w = decalColor.w * Ambient.w;
  23.       }
  24.  
  25.